import { Graphics, Sprite, Text } from "pixi.js";
import { MapCellSize } from "../config/game-config";
import { LoaderManager } from "../util/LoaderManager";

export enum CellType {
  grass, // 草地
  forest, // 森林
  river, // 河
  mountain, // 山
  plain, // 平原
  city, // 城池
}

export class MapCell extends Sprite {
  public cell_type: CellType | undefined = undefined;
  public cell_render: Graphics | undefined = undefined;
  constructor() {
    super();
    this.width = MapCellSize;
    this.height = MapCellSize;
  }

  init(cellType: CellType) {
    this.texture = LoaderManager.resource[CellType[cellType]].texture;
    this.cell_type = cellType;
  }
}
